#include <stdio.h>
#include <assert.h>
void* my_memcpy(void* dest,void* src,size_t num)
{
    int i = 0;
    void* ret = dest;
    //因为操作后的dest已经不在原位置了,需要记录初始的位置进行返回
    assert(dest && src);
    //dest和src不能为空指针,用断言来保证
    while (num--)
    {
        *(char*)dest = *(char*)src;
        src = (char*)src + 1;
        dest = (char*)dest +1;
        
        
    }
    return ret;
}

int main(void)
{
    int arr1[] = { 1,2,3,4,5,6,7,8,9,10 };
    int arr2[10] = { 0 };
my_memcpy(arr2, arr1, 20);
    int i = 0;
for (i = 0; i < 10; i++)
{
printf("%d ", arr2[i]);
}
return 0;
}